package com.tuxing.draa_data.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 中文核心期刊要目总览
 * </p>
 *
 * @author yuanshihang
 * @since 2022-04-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("new_dc_cj_pu")
public class NewDcCjPu implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId("ID")
    private Long id;

    /**
     * 期刊ID
     */
    @TableField("RECORD_ID")
    private Long recordId;

    /**
     * 学科ID
     */
    @TableField("SUB_ID")
    private Long subId;

    /**
     * 创建人
     */
    @TableField("CREATE_BY")
    private Integer createBy;

    /**
     * 创建时间
     */
    @TableField("CREATE_DATE")
    private LocalDateTime createDate;

    /**
     * 更新人
     */
    @TableField("UPDATE_BY")
    private Integer updateBy;

    /**
     * 更新时间
     */
    @TableField("UPDATE_DATE")
    private LocalDateTime updateDate;

    /**
     * 年份
     */
    @TableField("YEAR")
    private Integer year;

    /**
     * 主学科ID
     */
    @TableField("MAIN_SUB_ID")
    private Long mainSubId;

    public void create(Long recordId, Long subId,  Integer year, Long mainSubId) {
//        this.id = id;
        this.recordId = recordId;
        this.subId = subId;
        this.createBy = -1;
        this.createDate = LocalDateTime.now();
        this.updateBy = -1;
        this.updateDate = LocalDateTime.now();
        this.year = year;
        this.mainSubId = mainSubId;
    }
}
